﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CategoryList.ascx.cs"
    Inherits="BackEnd_CategoryList" %>
<%@ Register Src="CategoryModify.ascx" TagName="CategoryModify" TagPrefix="uc1" %>

<script language="javascript" type="text/javascript">
		function confirmDelete(id)
		{
			if (confirm("Sẽ xóa hết các sản phẩm của mục  này. Bạn có chắc chắn muốn xóa không ?"))
			{
			    window.location="<%=_Url%>"+id;
			}
		}
</script>

<table id="Table2" cellspacing="1" cellpadding="1">
    <tr>
        <td class="toolbar">
            <b>
                <%=this._Session %>
            </b>
        </td>
    </tr>
    <tr>
        <td>
            <uc1:CategoryModify ID="CategoryModify1" runat="server" />
        </td>
    </tr>
    <tr style="text-align: left">
        <td align="center" colspan="4" style="width: 908px">
            <asp:Label ID="labMessage" runat="server" Width="100%" ForeColor="Red" Font-Bold="True"></asp:Label>
        </td>
    </tr>
    <%--OnRowDeleting="grid_RowDeleting" AutoGenerateDeleteButton="True"--%>
    <tr>
        <td align="left">
            <asp:GridView runat="server" ShowHeader="true" ID="grid" BorderColor="#CC9966" BorderStyle="None"
                BorderWidth="1px" RowStyle-BorderWidth="0" RowStyle-BorderStyle="None" Width="100%"
                AlternatingRowStyle-BackColor="#f8f8f8" AlternatingRowStyle-BorderColor="#f8f8f8"
                HeaderStyle-BackColor="#F1F1F1" CellPadding="4" AutoGenerateColumns="False" AutoGenerateEditButton="True"
                OnRowEditing="grid_RowEditing" OnRowUpdating="grid_RowUpdating" AllowSorting="True"
                BackColor="White" ShowFooter="True" AllowPaging="True" OnPageIndexChanging="grid_PageIndexChanging"
                PageSize="20">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <a href="#" onclick="javascript:confirmDelete(<%#Eval(Component.ColumCategory._Id)%>)"
                                value="xoa" style="width: 76px">Xóa</a>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tên">
                        <ItemTemplate>
                            <%#Eval(Component.ColumCategory._Name)%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox runat="server" ID="txtName" Text='<%#Eval(Component.ColumCategory._Name)%>'
                                TextMode="MultiLine" />
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tên EL">
                        <ItemTemplate>
                            <%#Eval(Component.ColumCategory._NameEL)%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox runat="server" ID="txtNameEL" Text='<%#Eval(Component.ColumCategory._NameEL)%>'
                                TextMode="MultiLine" />
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Thứ tự">
                        <ItemTemplate>
                            <%#Eval(Component.ColumCategory._Priority)%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox runat="server" ID="txtPriority" Text=' <%#Eval(Component.ColumCategory._Priority)%>' />
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Kích hoạt">
                        <ItemTemplate>
                            <%#Eval(Component.ColumCategory._Active)%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList ID="ddLAct" runat="server">
                                <asp:ListItem>true</asp:ListItem>
                                <asp:ListItem>false</asp:ListItem>
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Thứ tự">
                        <ItemTemplate>
                            <a href="  <%#Eval(Component.ColumCategory._UrlAdmin)%>">Các chủ đề con</a>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Left" />
                    </asp:TemplateField>
                </Columns>
                <RowStyle BorderStyle="None" BorderWidth="0px" />
                <HeaderStyle BackColor="#F1F1F1" />
                <AlternatingRowStyle BackColor="#F8F8F8" BorderColor="#F8F8F8" />
            </asp:GridView>
        </td>
    </tr>
</table>
